package com.nondo.rdp.finance.endpoint.api.app.stock;


import com.nondo.rdp.auth.endpoint.model.Query;
import com.nondo.rdp.core.model.View;
import com.nondo.rdp.finance.service.MarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 自选股票
 */
@RestController("apiStockChoose")
@RequestMapping("/api/stock/choose")
public class ChooseEndpoint {
    @Autowired
    MarketService marketService;

    @RequestMapping("/index")
    public View<Map<String, Object>> index(@RequestBody Query<Map<String, Object>> query) {
        return marketService.chooseIndex(query);
    }

    @RequestMapping("/add")
    public View add(@RequestBody Map<String, Object> stockChoose) {
        return marketService.chooseAdd(stockChoose);
    }

    @RequestMapping("/delete")
    public View delete(@RequestBody Map<String, Object> stockChoose) {
        return marketService.chooseDelete(stockChoose);
    }

    @RequestMapping("/check")
    public View check(@RequestBody Map<String, Object> stockChoose) {
        return marketService.chooseCheck(stockChoose);
    }
}
